package com.zkc.stume.controller;

import ch.qos.logback.core.net.SyslogOutputStream;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zkc.stume.bean.Provinces;
import com.zkc.stume.service.ProvincesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jdk.nashorn.internal.ir.annotations.Reference;
import org.apache.catalina.util.RequestUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@Api(description = "省市区三级联查三级联查")
public class IndexController {


    @Autowired
    private ProvincesService provincesService;

    @ApiOperation(value ="第一次访问thymeleaf页面")
    @GetMapping("/index")
    public String index(Model model){
        model.addAttribute("name","南帝北丐中神通");
        return "index";
    }

    @ApiOperation(value = "三级联查JSON字符串")
    @GetMapping("/provinces")
    public String provinces(ModelMap model){
        model.addAttribute("provinces",provincesService.getAll());
        return "san";
    }
















}
